package com.kly.user.enums;

public enum TrafficSourceEnum {

    Organic(1, "Organic", "自然流量"),
    None_Organic(2, "None Organic", "非自然流量"),
    All(3, "All", "全部"), // 类型为其它时，不作处理
    ;

    private final int type;

    private final String Value;

    private final String description;


    TrafficSourceEnum(int type, String value, String description) {
        this.type = type;
        Value = value;
        this.description = description;
    }

    public int getType() {
        return type;
    }

    public String getValue() {
        return Value;
    }

    public String getDescription() {
        return description;
    }


    public static TrafficSourceEnum fromType(int type) {
        for (TrafficSourceEnum userStatus : values()) {
            if (userStatus.getType() == type) {
                return userStatus;
            }
        }
        return null;
    }
}
